home *** CD-ROM | disk | FTP | other *** search
/ USGS: Coal Resource Asse… Rocky Mts & Great Plains / USGS Coal Resource Assessment - Rocky Mts and Great Plains - Disc 2.iso / PROGRAM / EXT32 / CIB.AVX < prev    next >
Text File  |  1998-07-18  |  4KB  |  40 lines

  1. /3.1
  2. (Extension.1
  3.     Name:    "CIB Image Support"
  4.     Dependencies:    "$AVBIN/cib.dll\n"
  5.     FirstRootClassName:    "Script"
  6.     Roots:    2
  7.     Version:    30
  8.     About:    "Extends ArcView to support CIB images (v3.1)."
  9.     LoadScript:    3
  10.     CanUnloadScript:    4
  11.     UnloadScript:    5
  12.     ExtVersion:    3100
  13. )
  14.  
  15. (Script.2
  16.     Name:    "CIB.ObjectsPresent"
  17.     SourceCode:    "theProject = av.GetProject\nif (theProject = NIL) then\n  return FALSE\nend\n\nfor each e in Clipboard.The\n  if (e.Is(ITheme)) then\n    theImgSrc = e.GetImgSrc\n    theSrcName = theImgSrc.GetSrcName\n    if (ImgCat.IsValidFileName(theSrcName.GetFileName)) then\n      if (theImgSrc.ContainType(ISrc.ReturnTypeFromFileExt(\"cib\"))) then\n        return TRUE\n      end\n    else\n      if (theImgSrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"cib\")) then\n        return TRUE\n      end\n    end\n  elseif (e.Is(ViewFrame) and e.IsF
  18. illed) then\n    for each aTheme in e.GetView.GetThemes\n      if (aTheme.Is(ITheme)) then\n        theImgSrc = aTheme.GetImgSrc\n        theSrcName = theImgSrc.GetSrcName\n        if (ImgCat.IsValidFileName(theSrcName.GetFileName)) then\n          if (theImgSrc.ContainType(ISrc.ReturnTypeFromFileExt(\"cib\"))) then\n            return TRUE\n          end\n        else\n          if (theImgSrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"cib\")) then\n            return TRUE\n          end\n        end\n      end\n    end\n  else
  19. if (e.Is(PictureFrame) and e.IsFilled and e.IsFilledBy(FileName)) then\n    theFillObj = e.GetFillObject\n    if (ISrc.IsValidFileName(theFillObj)) then\n      theISrc = ISrc.Make(SrcName.Make(theFillObj.AsString))\n      if (theISrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"cib\")) then\n        return TRUE\n      end\n    end\n  end\nend\ntheDocs = av.GetProject.GetDocs\nfor each aDoc in theDocs\n  if (aDoc.Is(View)) then\n    for each aTheme in aDoc.GetThemes\n      if (aTheme.Is(ITheme)) then\n        theImgSrc = aTheme
  20. .GetImgSrc\n        theSrcName = theImgSrc.GetSrcName\n        if (ImgCat.IsValidFileName(theSrcName.GetFileName)) then\n          if (theImgSrc.ContainType(ISrc.ReturnTypeFromFileExt(\"cib\"))) then\n            return TRUE\n          end\n        else\n          if (theImgSrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"cib\")) then\n            return TRUE\n          end\n        end\n      end\n    end\n  elseif (aDoc.Is(Layout)) then\n    for each aGraphic in aDoc.GetGraphics\n      if (aGraphic.Is(PictureFrame) and aGraphi
  21. c.IsFilled and aGraphic.IsFilledBy(FileName)) then\n        theFillObj = aGraphic.GetFillObject\n        if (ISrc.IsValidFileName(theFillObj)) then\n          theISrc = ISrc.Make(SrcName.Make(theFillObj.AsString))\n          if (theISrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"cib\")) then\n            return TRUE\n          end\n        end\n      elseif (aGraphic.Is(ViewFrame) and aGraphic.IsFilled) then\n        for each aTheme in aGraphic.GetView.GetThemes\n          if (aTheme.Is(ITheme)) then\n            theImgS
  22. rc = aTheme.GetImgSrc\n            theSrcName = theImgSrc.GetSrcName\n            if (ImgCat.IsValidFileName(theSrcName.GetFileName)) then\n              if (theImgSrc.ContainType(ISrc.ReturnTypeFromFileExt(\"cib\"))) then\n                return TRUE\n              end\n            else\n              if (theImgSrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"cib\")) then\n                return TRUE\n              end\n            end\n          end\n        end\n      end\n    end\n  end\nend\n\nreturn FALSE"
  23. )
  24.  
  25. (Script.3
  26.     Name:    "CIB.Load"
  27.     SourceCode:    "'for CIB, set the extension checking to false, so any files are shown...\nISrc.SetExtensionChecking(FALSE)"
  28. )
  29.  
  30. (Script.4
  31.     Name:    "CIB.CanUnload"
  32.     SourceCode:    "' Run script CIB.ObjectsPresent to see if there is any ImgSrc in any View with a .cib extension.\n' Return result to boolean variable.\nobjectsPresent = av.Run(\"CIB.ObjectsPresent\", NIL)\n\n' If objectsPresent is TRUE the dll should not be unloaded\nreturn objectsPresent.Not"
  33. )
  34.  
  35. (Script.5
  36.     Name:    "CIB.Unload"
  37.     SourceCode:    "'Set extension checking back on if CADRG is not installed\ntheExt = Extension.Find(\"CADRG Image Support\")\nif (theExt = NIL) then\n  ISrc.SetExtensionChecking(TRUE)\nend\n"
  38. )
  39.  
  40.